package com.tcgroup.phone.base_core.binding.textimagebutton;

import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableBoolean;

import com.tcgroup.phone.base_core.R;
import com.tcgroup.phone.base_core.widget.TextImageButton;

/**
 * 作者: wangfei
 * 创建时期: 2020/4/15.
 * 包名: com.tcgroup.phone.base_core.binding.textimagebutton
 * 类名: OSAndroidMvvm
 */
public class TextImageBindAdapter {

    @BindingAdapter("title_color")
    public static void setTitleColor(TextImageButton textImageButton, ObservableBoolean flag) {
        if (flag.get()){
            textImageButton.getmTvTitle().setTextColor(textImageButton.getContext().getResources().getColor(R.color.primary_color));
        }else {
            textImageButton.getmTvTitle().setTextColor( textImageButton.getContext().getResources().getColor(R.color.transparent80_gray));
        }
    }
}
